<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
    <title>过度</title>
    <style>
        .fade-enter-active,.fade-leave-active{
            transition: opacity 2s;
        }
        .fade-enter,.fade-leave-to{
            opacity: 0;
        }
    </style>
</head>

<body>
    <div id="box">
        <button v-on:click="show=!show">切换</button>
        <transition name="fade">
            <p v-if="show">理想是人生的太阳</p>
        </transition>
    </div>
    <script>
        new Vue({
            el:'#box',
            data:{
                show:true
            }
        })
    </script>
</body>

</html>